
function ShowQMenu()
	MENU = vgui.Create( "DFrame" )
	MENU:SetSize( ScrW()*0.8, ScrH()*0.8 )
	MENU:Center()
	MENU:SetTitle( "Ultima GMOD" ) // Name of Fram
	MENU:SetVisible( true )
	MENU:SetDraggable( false ) //Can the player drag the frame /True/False
	MENU:ShowCloseButton( false ) //Show the X (Close button) /True/False
	MENU:MakePopup()
	
	local INVENTORY = vgui.Create( "DFrame" )
	INVENTORY:SetSize( ScrW()*0.5, ScrH()*0.5 )
	INVENTORY:Center()
	INVENTORY:SetBackgroundBlur( true )
	INVENTORY:SetTitle( "Inventory" ) // Name of Fram
	INVENTORY:SetVisible( true )
	INVENTORY:SetDraggable( false ) //Can the player drag the frame /True/False
	INVENTORY:ShowCloseButton( false ) //Show the X (Close button) /True/False
	INVENTORY:SetParent(MENU)
	INVENTORY:MakePopup()
end 

function HideQMenu()
	MENU:Close()
end

-- Press q
function GM:OnSpawnMenuOpen( )
	ShowQMenu()
	gui.EnableScreenClicker( true )
	RestoreCursorPosition( )
end

-- Unpress q
function GM:OnSpawnMenuClose( )
	HideQMenu()
	RememberCursorPosition( )
	gui.EnableScreenClicker( false )
end